namespace LightBox.Design
{
    using System;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Web.UI.Design;

    /// <summary>
    /// 
    /// </summary>
    class ScriptManagerActionList : DesignerActionList
    {
        private ScriptManagerDesigner designer;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="designer"></param>
        public ScriptManagerActionList(ScriptManagerDesigner designer) : base(designer.Component)
        {
            this.designer = designer;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();
            items.Add(new DesignerActionPropertyItem("InstallFiles", "Install Lightbox Files To Disk"));

            return items;
        }

        /// <summary>
        /// 
        /// </summary>
        public bool InstallFiles
        {
            get
            {
                ScriptManager mgr = (ScriptManager)designer.Component;
                return mgr.InstallFiles;
            }
            set
            {
                ScriptManager mgr = (ScriptManager)designer.Component;
                TypeDescriptor.GetProperties(mgr)["InstallFiles"].SetValue(mgr, value);
            }
        }
    }
}